/*
 * @Description: while循环
 * @Author: rendc
 * @Date: 2025-07-21 11:17:54
 * @LastEditors: rendc
 * @LastEditTime: 2025-07-21 11:40:53
 */
public class Test02While {

  public static void main(String[] args) {
    // 控制台输出0-4
    int i = 1;
    while (i <= 5) {
      // System.out.println("i:" + (i - 1));
      i++;
    }
    // 0-100的奇数之和
    int sum = 0;
    // 找奇数
    int j = 1;
    while (j <= 100) {
      // System.out.println("j:" + j);
      sum += j;
      j += 2;
    }
    System.out.println("sum:" + sum);
  }

}